adding code details to figure 4