Fixed errors, use of error handling remains in parts a mystery