Got a sort algorithm somewhat implemented