updated code and figures