made code more effient so that it runs faster