Updated script to recieve serial inputs