Removed the error struct. Simplified the return codes, so that we only return ints back