update

update - cleaning up and adding some more comments.