Finalize arduino code to receive input from serial