Add check
Add code to fix the never ending loop
Turns out that pops the left bracket
Removed the function check as it is what caused the error
Update readme on algorithm
Whitespace