improved more code