Improved table comments
Cleaned up code
Used DOUBLE instead of FLOAT
Improved comments and coding style
Cleaned coding style. Added comments.