first bit of semi-working code.