replaced this file with just the js function