SML optimisations/changes n stuff