Minor changes to composite.py to hopefully clean up the algorithms a little