Fixed a few bugs and added some polish.