Added some very basic input checks. Removed Duplicate utilities

Added some very basic input checks.
Removed duplicate utility functions I forgot to remove.