epic cleanup
contains bugs with sort