fixed apply. example from wikipedia is running!