Algorithm code blocks