Fixed major bug which was killing performance - still needs work, but now the concept is at least working