math.ceil where needed added