pretty much same thing -- cleaned up code a bit