revamp the hash anchor function