implemented comaprision sort