Remove use of global variable and fix spacing issue after lastname