fixed bugs. cleaned up.