Implemented declarations in if, while and switch. Also removed commented code that is no longer needed.