making more things into methods
minor indentation/linking fixes