First optimization attempt