cleanup alogrithms a bit
generate options bug