Merging Motor program with sockets