consolidated many general algos
consolidated many general algos