changed algorithm for password recovery