Modified code to work with literal ascii values.  Primarily subtracted '0' from most of the code where necessary in order to obtain a literal 0 or 1.   (00000000 or 00000001)