Added existing code and fixed formatting and naming conventions