Hi,
It took me a while to understand the functionality of the app so i made a (badly drawn) pictorial summary of what the code does at this stage.
Maybe it will help someone who is also trying to make sense of what is going on.
If anyone spots a mistake please let me know. It will improve my knowledge and hopefully that of others.