Big fixes, CND recoded, ect.

- Fixed some bugs
- Removed some unecessary code
- Recoded CND