moved main definition