Updated update function to include new lines
Updated again to account for new lines