finished except for sorting