Fixed names
Added exceptions
Added tests