expanded section2 and placed pseudocode and table in environments