Debugged calculations; ready for testing