bugs
hash optimization