Made the program a little more efficient