wrote a lot better implementation of stringtask