Updated formatting and removed cpp style code in favor of pythonic-ish code