same comment above about breaking things into functions applies to this branch