Implemented train from file and directory. #4