Error detection part of code starts after this comment