added tests & validation