cleaning code, fixing revision bugs