put function in the right place