move rest of calculations into nonclass functions