Comments would be helpful to understand the logic without having to actually try the code or look at the UI :) Can you add comments to the code?