Efficient code for Small Multiple