shuffled around more code