Added many descriptive comments, fixed a small issue with fraction part.