changed code. I didn't like the code i was using