implemented line_memory