Update code. Probably is finished