stable code for all initializations and sgh