still haven't figured out logic for nil objects error.  learning some refactoring techniques to break down this huge controller logic