bug fixes. need to tighten things up.