incorporated a bunch of changes made to rx in other projects