Refactored logging, snap to grid