Implementing reverse function and password chain