add some code organisation. gotta run now though.