Removing extraneous spaces from this code