removing test code from main