refactor and add input validation
Merge pull request #54 from PaulMorris/vert-scaling-refactor

refactor and add input validation