remove lagrant code