changed type from unsigned to int