more details in algorithm