k-RBC implemented and debugged; error routines added