Proper encoding of corners :)