they had also learned how to behave like proper gentlemen ; they had learned how to read and write and do simple math , how to keep accounts and how to bargain and trade and barter to their advantage .