added initialization procedure and reset global values following doctests