Major refactoring and Finished adding iPar to drr.m