created the passgen function
Updated to use classes