clean up code, runs in 0.15s