moved main to test