added tests, cleaned up App, simulation works OK