started validation function
merged in questions