todo optimization
debugging