Slight tweaks but still 100x slower than it needs to be