Fixed a bug in lab 3