cleaned up initcubemesh a little