added validation stuff
merged conflicts