First quickly hacked together version.