Understanding the conformational stability and electronic structures of modified polymers based on polythiophene