fixed code spacing

cleaned up code and fixed spacing