list of figures added. cleaned up code