Initital set-up and base code