Tested and working, still some UI bugs