Fixed a bug, cleaned code

I fixed a bug that would prevent 0% from showing up correctly. Cleaned up the code and added documentation.