stated implementing javascript functionallity