rewrite silly code