Restructured code, made faster.