more code cleanup
bases almost working again, octal still has boundary issue