implemented a cost basis calculation