Added summaries and fixed some code