fixed the ceil function, ambiguous call problem in vs 2010