refactored the sliding-headings prototype.
extensive refactoring of the sliding-headers prototype
greatly reduced the complexity of the code.
added comments