minor modifications to source