Updated to working version (typed only partially).