add robustness to ulam spiral draw