initializing r in sources to make more strict gcc happy