fin attempt of optimization