lots of improvements; first working automatic mode