#7 Replaced errors with exceptions