#39 changed state architecture and fixed issue with level time calculating