Added Version Checks. Plus Massic code clean up