LGN functions are now in a more compact way, remove of boiler-plate code replaced by a loop