added simple sorting implementation