Added function for issue #43