all functions work, and gui works, code is ugly