Now creates files correctly