added comments to interval and timeout function