algorithm activity, implement keyboard controls and improve UI
(cherry picked from commit 654f7dfb7d322a910ea95b90ddbea4014d1fa0ca)