change the return type of drawGraph method to boolean