fixed input polling; fixed matrix -> array conversion