Lab2: draft implementation