Fixed spacing and added terminal size check