private int berekenIndex(boolean top, boolean right, boolean bottom, boolean left){
        int index = 0;

        if(top) index += 1;
        if(right) index += 2;
        if(bottom) index += 4;
        if(left) index += 8;

        return index;
    }