added unrealized gain feature