Cleanup and comments for mva code