Made the program more efficient and faster