changed some names, changed implementation, removed dependency