fixed bug in main-loop - was holding on to the head of the seq
more instructions!
some JVM optimisations that i had forgotten