moved main outside.