Attempt at final optimization