Implemented the readAttribute method and added a thorough(?) test