added karma and tests