Modifying sample data script to accept maxLayoutCount parameter