Computing sizes and positions