Pushing relevant code to github so Dave can see issue on line 386