Vaguely styled now. Needs comments re-added post-refactor