3.3 det better algorithm