modified how to get points from db