Create function to determine criterion
Implementation successful, some libraries added