Now using arrays and quering as less as possible.