writing code from start