updated figure generation