added functionality for width, refactoring of code, code examples in index.html