Theory of the behaviour of flexible polymers in limited volumes