Version (3.8a)

Complete rewrite and many bug fixes