calculations and frontend finsihed