Finish up most of code. Still need to do minor debugging, though.