adding new dependencies
added scratch directory support; merge almost works