minor design changes
added recusive deletion of tmp directory