completed version, needs review