Added documentation, fixed missing bounds check on rm_op