pattern algorithms with json loader example