Changed logic, making the loading about 20% faster.