update code for clarity
added test input