rewrite function that creates inputs object