Adding more error checking
moving hardcoded generator out of here