erased old code, made a new function for serial robots