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