Update after review and fixed some small bugs