merged all hive code