The original code for this is from the red Geek Dad book