Fixed a bug when I was using the "y" variable twice.

Added in the join for the Activity stuff.