more optimizations and some demo page