Also, I think it would make sense to break this apart into smaller methods w/ descriptive names.