A model for animal behaviour which incorporates feedback