added input validation in grabFieldValues()
moved things around