fixed for chrome; integrated jQuery; made some optimizations and refactoring