new javascript tutorial
style and cleanup