improving efficiency of assemble, adding test_condense code