predict method added and updated