code from assemble force modified