updated core algorithm and verbose mode