Solving for dimensions or Optimization