code cleaning + documentation.