improve repmat not to use reshape, make 2nd dim argument optional