data partitioning code added