added sendmessage to itask and cleaned up old code