fixed a bug in the r class and added new tests