fixes #25 sorting issues