finish the SML part of hw07