Got rid of some variables and used a class instead.