made planning take reward matrix; added simple reward estimation in em