Ok, wow.... I have had too many shots of captain to completely answer this question so what I will tell you is that...
#1- The tank is probably not cycled. Click on search at the top of the page and search for cycle. You will understand what I'm talking about.
#2-You should do waterchanges on your tank weekly.
#3- What fish are in there? If they are goldfish, your tank is overstocked.
#4- Is it in front of a window? Is the light left on for very long periods of time? If so, this could be algae.
#5- The brown sludge was likely a mixture of food and poop. This will not occur if a gravel vac is used weekly, the tank isn't overfed, and the fish aren't producing more waste than can be cleaned up during weekly waterchanges.
#6- You should not clean out the entire tank at once. This will cause you to lose the bacteria needed for a cycled tank.
If you search for cycle and do some research, you will find all the answers you need. They are here...I promise
