Updated constructor to use either string or int