a3.c functions