finished coding the validation functions for now. untested