New commit

@toopay  Here is the new pull request from my old one with conflicts.