wrote input selecters
wrote TPU (not checked well)