refactoring version sorting. See #60