cleaned up spacing code