Ian: add primary and secondary bitmap parsing