Basic sort algorithms in python