fixed small style issues
added ability to use the cached functionality