wip: gain and loss working