Magic numbers replaced with constants. Ceiling and isWeekend moved to functions
Some formating fixes.
Blocks implementation modified.