implemented input, renamed tile1,tile2