Created by: larsyunker
Added additional file for PyRSIR example. Also fixed some bugs and optimized loops