Updated main and tests