Fixed bugs and updated pdf