Updated test routine