refactored loop and io, added uID and SystemExit