Updated js syntax and added age checking