use readline to great effect
minor changes