Updated python code to output raw bits too