Nicer code
Closed #2