beginning of code