Added serial input and less hacky data logging