Applies style rules

Tried to apply ruby style rules without tampering with the functionality.