updated style, added validation