added dir components
global input
refactor everything