add inline docu and add checking for inputs