list_prev function & tests