In the setPosition function function at line 102 there are two undefined variables (tot_row and tot_col).
@DoDzilla-ai thank you for pointing out the two issues. Feel free to send a pull-request with those fixes and I will integrate them in the code base.