added new features and validation