Cleaned up code to actually make directories instead of assume they are ther