merge signed, unsigned into one func