fixed the code a bit.