improved
Merged with loops ratio trick