Added another variable and fixed some problems that I was having.