Updated to use proper coding standards