implemented reading inputs