added ceil and added variable