Added new code for trading and libraries