Working version, fixed imports and some bugs in eca