converted several longer condtional statements to shorter forms