fixed read errors and added bool implementation