completed figures, some bug fixes