first part of anegram problem