initial implementation of sort algorithms