First commit on validation and logic