modified adv password library for reflecting rand