reworked version with get popping the hash