fix stupid typo bug in parimap
rewrite by-epoch fitting code to be much (much (much)) faster