Added calculatesteps