Infinite loop bug fix

RPM 5D simulator fully implemented