changed invert(int) method according to the feedback on github
updated javadocs for contains...