Completed the boolean funtion according to the flowchart.