Added autotest functionality