added sorting method (version 1)
fixed NP exception by changing evaluation order
Merge branch 'alternatives' of github.com:movsim/movsim into alternatives