Validation

Started work on validation functions.