adding algo to implementaation