Initial code review

Pseudo-PR to allow comments
these two conditions seem codependent, do they need to be separate?