gain level function added