First commit

Please excuse the messy code :-P