removed global namespace, added define guard