initial quick method written, now trying to refactor