better code for getting cover (not perfect, but it works)