GM algoritm
added strToBits
added bitsToStr