small adjustments to old code