Made it more efficient and removed some lines of code.