added user error checking and more testing