tries basic implementation