Move prediction code to separate file. Also crop to LS path/row.