added new hash lib and cleaned up algo