Remove static initialization, which didnt work because of ordering problems, and replace with brute force method.