added  functionality to take negative values