New and more powerful implementation