using constants instead of global variable