New update function for line by line
Add sample