Removed some magic numbers
Added missing comments
Code review