refactored code base
removed sprintf