Fully working with pretty complete error handling