Fixed decimal problem. Added some comments. Added the code header