added test, other modifications