More tests, fixed calculate

but changes in the meantime may cause it not to work anymore :(