more optimizations. works with 400 400 400 in about 10 seconds for example.