update solution with final sweep and fix gender mapping