Added -v, -u, cleaned up some code