Checked that function worked