stats
Fixed code (mostly)