Write function working in prelimenary fashion.