Bug fixes and complete d project 2 code

The project folder says project 1, but it's really project 2.