Implemented logic for all figures. Fixed minor issues and problems.