Learning to hoist the mainsail