adding the comprehensive function