Fully working just need to add more tests. Added exceptions