changed some variables names etc