updated code blocks