it works but is not optimized