Implementing standard sort algorithms