formatted algorithm part