cleaned up a bit; minor bugfix