Working, (slightly) faster than previously, but before I grid it up to try and increase performance