corrected small errors after testing