first pass solution