replaced Object.keys with more backwards compatible version
added minimized version