Fixed code format

updated code formatting and addressed warnings (that weren't stupid)