tweaks to derep code..