some code from different reference