updated to allow input function to take units as well