Fix duplicate code in Lab10