Sem: still doesnt compile, helper function