completes chapter 10, - cons function

Signed-off-by: Alexander Skjolden <alex@plastboks.net>