this is the first script that works making the hash reference properly