removed dead code and added comments to chat.