clean up code
added generate and check passpharse method