rewrite function to replace zeros with the max odd number to the right more cleanly based on writing out sudo code