added optimization