Even though my first version has not yet been accepted, I managed to make it smaller and adding the following improvements: