Added comments for documentation and some debug printfs