solves gem stones problem
update template