Massive Code Update

Includes MPG calculation