Tasks state change functions bugs corrected, recommented code functions