added some minor modifications