fixed bug in points, added extra conditions