added all code, time to debug (lots of bad code here; will revise, but under time crunch thanks to career fair)

Signed-off-by: Danny McClanahan <danieldmcclanahan@gmail.com>