added typechecking for javascript using Flow