pasted from the code I had been working on