created trienode class and started working on it