cleanup and fixed small number problem