Changed function so return value is boolean based on result