Cleaned up attachRow fn