massive speed and memory improvements