Add some calculating functions