added calculate_up