optimized js functions, modified readme