- This looks more pythonic now and with less code. Not tested yet.