changed format for creating temp directories and their locations. Also re-implemented tests