disabled sorting and clean up code