calculation added with tests, calculating with existing past data functionality is to be added