Try to write my own slam program.