Changed error syntax and gave errors type ArgumentError