Just a nitpicking but ...

1.) For sorting, it's usual to use |a,b| variables
2.) 50 is a constant, actually both of them