More robust way of calculating the falling layer