better implementation, does not replace any lines