removed redundancies, added exceptions