Restructured to use a point class for position in logic