Nicer code

This one actually works.