Rewrote and expanded tests