adding code to fix percentage variable