made adjustments to the code, but still buggy