hash version working perfectly