refactor to initial work on lab1