Fixed a lot of weirdly written code and changed outputs of VI to be more useful.