Adding calculations

I added a bunch of calculations and changed the database structure, so good luck to anyone with an older version where it no longer works!