Fixed more bugs and modified the way we handle the join function