added vis functions. Changes to trim functions in pred.py"