Implementation of hcat. Hopefully no bugs.