improved performance a bit. Changed inline.