Lab 4 funtions