Okay. I doubt anyone will want to read the source code. I'm not good at programming so it became 1500 lines of code but anyways, here's an update and the src code: