Rough working version.