Pretty much finished

Works for the most part, comments still to come...