Replaces the code which adds active class to links, by a smaller for-loop