Working version. Almost ready to submit.