Second, improved version