removed stupid swap function