Code
Main part finished