cleaning up comments
fixed function typo
adding more debug printing
adding some debug print statement. Explicitly resizing & copying some ephemeral state vars