code that works properly