Refactor, fix bit parsing

The bits were being returned in the reverse order expected.