Cleaned up code to JS standards, added optional slide threshold