adding javascript--still has bugs!