I made the code more clean. This has been a lot of work.