Added tests, and started working on validation