made into a javascript framework