Fixed the issue during the review! Works perfectly, I have my own attempt for lab2 and the revised and completely fixed version for lab3.