basic function for lab1