create ride function fully written.