Working on trade function