Changed code to be closer to what Phil is doing