The laws of habit