Changed boolean function to match assignment 3