Rework input handling
add a simple AI