Cleaned up parse script, but there is still a bug in processing of files