Play the melody, find space for the riff. Don't play the riff and use then use leftover time to sort of play the melody.