changed some variable to private