lab1 basic implementation