coding of contouring module - not ready, not fully tested