Unraveling the mysteries of habit formation