Basic sorting based on qualities implemented