Added algorithm part.