add gain tests and updated to handle gain quantities