finish the OA model algothm