Fix compilation error
Add out files
Add sort function prototype
Fix bugs
Add test main
Add sort function implementation