added function to checks critiria are fulfilled