Changed code for figure