Using toggleClass instead of if/else. Fixed #12