figured out smallest xy code