Test code now takes file as argument