finish implementation of joins