Added Comments and error tracking