Edwin/code counter

got it to work finally!!! Best feeling in the world after hours!