Added checks for valid arguments along with helpful error messages