updated motiongraph with computepred, added isvalidstate func, and added rude graph visualization function