eight commit

merged barrys code with mine and some miner tweeks