made adjustments to code