Added comments, cleanups & checks