v4

bugs fixed, and improvements.