Fix issue 20 for good

Basically, the initial code completely forgot about borders ;p
I tried to keep the code properly compartmented, but I quite new at ObjC, so probably far from perfect.
However, it works, even if odd values mess stuffs up a bit (but nothing hard to work around), and not on the first time.