Switched to new swift syntax
Fixed all warnings