Code merge

Merged niko's code
Code merge 2

Added niko's code
Code merge 3

Merged the rest of niko's code