another optimization attempt