Added headOnly flag to snake generator