A version that checks for multiple mains