fixed potential buffer overflow
Pre initialized bit pattern to speed things up