Adding test for optimize call