Updated code to latest

+Fixed code sections that were outdated