Data logging added to working randomized model (Asgn1)