Improvements

Improvements added suggested by Eight on the HackForums. This should
optimize the code. :D