fixed issues in calculate_forces function
minor fixes