Efficiency IV

Made the code wayyyy more efficient