rescoping diamondPartLength so that it ain't global, removing console logs... log really needs to be replaced by a debug.logger