changed boolean[] to BitSet
removed functions
Test time down from 100 to 91 seconds