New version with a lot of improvements