Adding josh's code