Working version, makes two files