added toggle for train and test