input errror handling & first working version