main modified to test