updated training method