added phase cacheing

Conflicts:
	derec/derec_utils.py