Initial commit

Messy code, but works, fork as you like