General cleanup.
Added basic prediction