Very rough rewrite of bugger to ruby