Work in progress of conversion...code currently doesn't compile....DO NOT USE YET