Created
Added error handling
Fixed bugs