add lab2 base logic