many improvements and fixes.

Signed-off-by: Benjamin Ferrell <benjaminf333@gmail.com>