lab4v2: add more functions