Ported part of game play functions from js version; added icon buttons