add function to for