Small speed up implemented - still need to profile to find major bottlenecks (next on my todo list)