almost completed version