updated to do less
added fallthrough case
partway through factoring out helpers