added underscore js. also refactored the code a bit so that my current implementation of _.contains() is replaced with underscorejs