removed test code from main