intermediate commit of calculate()
working prototype