found logic error, missign variable, and wrong default
Merge remote-tracking branch 'origin/master'