Fix for issue 28 and added code samples