added getCost function
walkingspeed