changed some vars names, fixed a few places