Refined assignment_calculator.rb