Here is some code... It works sort of...

Doesn't fully work but that is about where I get in about 3 hours...