more math, added some extra samples