trying to fix the value changing problem due to addition of printing. Still don't know why that is happening