Updated ceiling and floor functions