Tried to implement type checking for dec