cleaned up unused functions

debugged sortMe function to work properly with partially filled arrays