it works, js needs improvement