Fixed bug with sorting
Finished hand functions