Fixed the single line bug as well as a logical error in my order of operations that I have noticed while running