adds runtime type checking for more useful error messages and expands readme