putting random things together as a first draft.

Can you please read the TODO in the comments. I am not sure what to do
in these parts.

Thanks