Replaced console for log and set self for array