added for parsing from file, fixing bugs