rounding up core algo implementation