new version

easier to read and improve