Defined the rob function