added hasPathSum