Reformatting. Inserted code comments. Cleaned interfaces.