minor changes on types
memory management, efficiency, novel simple algos