Little changes

There were a few unused variables, and I removed assigning to globals (such as 'id' and 'next').

Also, a simple test :)