Cleand the code following PEP8, and added a new function to chaincode