added train class and initialize method