Made more efficient so it hasn't got to keep searching through arrays.
Merge pull request #1 from orangemug/more_efficient

Made more efficient so it hasn't got to keep searching through arrays.