fixed nextRebound.m , some renames and code clean up