lots of changes. starting to add validation and good error handling