Basic Sort function working