TODO file
Optimize memory usage and improve speed