Working library model in javaScript.