added validation and crap