Update code. VERY BAD implementation.