main body of algw before test