Shortened has code function