cleaned up code setting correct spacing of spaces