Changing vb code to handle inputs correctly.