Initial version taken from beelist
more work