train function tests : done