added reshape dataset function