Step through your code.... Add print statements if you need to.

Get rid of those "else{}" they are unneeded

Check out the value of point[p] when you are assigning it to g, if point[p] is always...