Tests added and documentation updated