changes made along with mgehard. v1