Understanding the 4051Multiplexer code

what would then be the right way to have 8 buttons connect to 8 leds, using the minimum pins possible on the Arduino?