1. Added comments, error handling and rounding
2. Renamed variables
3. Used sprintf() function