Revison 2

added tempfile stuff