Updated fn to generate result in boolean instead of list