stable version with some commented-out code