added code to pass variables back and forth between views.