Added sort function

This one is pretty simple let me know if i missed anything. 
Also as a note, cannot really use functions for arrays they fail at the arguments requirements check, when you pass an array to a function as the first argument it will be treated as array of arguments.