Some speed improvemernts