implemented some functions for figures