Added validation functions, Code compiles now