made full-expand easier to read, added more tests
converted expand into a reduce operation
fixed naming collision