stats command implemented + minor cleanings