Added variable mainDir