revisions based off of input from @ne0fhyk