Updated Code to return -1.