Implemented first version of calculation. The days calculation is not correct yet. Cleaned up. Added some documentation.