Implemented Train method