integrated Hierarchies

also added better keyboard input management