mostly finished

need to add comments.