fixed some variables and such