2nd pass, comment/refactor

using regex instead of big && chain in my if statement and a few syntax
cleanups