Superficial optimization
Basic test file working

Only test1.txt seems to work, all others hang