fix problems with pass and clean up code so no internal game logic is done in the UI