finish diagram of the code