Added three variables and made some corrections

Added three variables and made some corrections