Fixed some variable names and changed some methods