improvements - speed and accuracy