updated main and tests