first working version of new embed algorithm.
Documentation needs to be revamped completely to match latest changes!