rewrite of inputParser, moved main to separate file