maked the algoritmes faster with short, chars and inline functions