added focal length in optimization