added capability to handle overlfow