renamed and relocated aman's code