IF curve example reproduced (needed a few changes)